/**
 * 
 */
package com.wolfpire.proms.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wolfpire.system.common.Constants;
import com.wolfpire.system.common.UnCover;

/**
 * 任务反馈 
 * @author lihd
 *
 */

@Entity
@Table(name = "t_feedback")
public class FeedBack implements Serializable{
	
	private static final long serialVersionUID = -5532095188375579427L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false, length = 16)
	private Long id;//主键Id
	
	@Column(name = "name", length = 255)
	private String name;//名称
	
	@Column(name = "remark", length = 255)
	private String remark; //反馈内容
	
	@Column(name = "task_id", length = 16)
	private Long taskId; // 所属任务
	
	@Column(name = "fact_amount", length = 20)
	private String factAmount;//实际使用资金
	
	@Column(name = "progress")
	private String progress; //进度
	
	@Column(name = "create_user_id", length = 16)
	private Long createUserId; //反馈者Id
	
	@Column(name = "create_user_name", length = 50)
	private String createUserName; //反馈者名称
	
	@UnCover
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date createTime = new Date();//反馈时间
	
	@Column(name = "update_user_id", length = 16)
	private Long updateUserId; //修改者
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date updateTime = new Date();//修改时间
	
	@Column(name = "del_flag")
	private Integer delFlag = Constants.NORMAL_FLAG; //伪删标识
	
	@Column(name = "status", length = 2)
	private Integer status; //审核状态（0:未审核，1：审核未通过，2：审核通过）
	
	@Column(name = "audit_remark", length = 4000)
	private String auditRemark; //审核意见（最后一次）
	
	@Column(name = "audit_user_id", length = 16)
	private Long auditUserId; //审核人Id(最后一次)
	
	@Column(name = "audit_user_name", length = 50)
	private String auditUserName; //审核人名称(最后一次)
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "audti_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date auditTime; //审核时间(最后一次)
	
	@Transient
	private Task task;
	
	@Transient
	private TaskPlan taskPlan;
	
	@Transient
	private Long[] attId;// 附件
	
	@Transient
	private Long[] attaFunds; //资金类佐证材料
	
	@Transient
	private Long[] attaResult; //成果类佐证材料
	
	@Transient
	private Long projectIndexId; // 所属指标
	
	@Transient
	private List<FeedBackAudit> feedBackAudits = new ArrayList<FeedBackAudit>();
	
	@Transient
	private Integer auditCount;
	
	@Column(name = "pre_amount", length = 20)
	private String preAmount;//预算用资金
	
	@Column(name = "plan_id", length = 16)
	private Long planId;//预算用资金
	
	/*@Transient
	private String taskName; //任务名称
	
	@Transient
	private String taskRemark; //任务内容
	
	@Transient
	private String projectIndexName; //项目指标名称
*/	
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "execute_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date executeTime;//修改时间
	
	@Transient
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date excTimeBegin;
	@Transient
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date excTimeEnd;
	
	@Transient
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date createTimeBegin;
	@Transient
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date createTimeEnd;
	
	
	public FeedBack() {
		super();
	}

	public FeedBack(Long id, String name, String remark, Long taskId,
			String factAmount, String progress, Long createUserId,
			Date createTime, Long updateUserId, Date updateTime,
			Integer delFlag, Task task) {
		super();
		this.id = id;
		this.name = name;
		this.remark = remark;
		this.taskId = taskId;
		this.factAmount = factAmount;
		this.progress = progress;
		this.createUserId = createUserId;
		this.createTime = createTime;
		this.updateUserId = updateUserId;
		this.updateTime = updateTime;
		this.delFlag = delFlag;
		this.task = task;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Long getTaskId() {
		return taskId;
	}

	public void setTaskId(Long taskId) {
		this.taskId = taskId;
	}

	public String getFactAmount() {
		return factAmount;
	}

	public void setFactAmount(String factAmount) {
		this.factAmount = factAmount;
	}

	public String getProgress() {
		return progress;
	}

	public void setProgress(String progress) {
		this.progress = progress;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	/*public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public String getTaskRemark() {
		return taskRemark;
	}

	public void setTaskRemark(String taskRemark) {
		this.taskRemark = taskRemark;
	}

	public Long getProjectIndexId() {
		return projectIndexId;
	}

	public void setProjectIndexId(Long projectIndexId) {
		this.projectIndexId = projectIndexId;
	}

	public String getProjectIndexName() {
		return projectIndexName;
	}

	public void setProjectIndexName(String projectIndexName) {
		this.projectIndexName = projectIndexName;
	}*/

	public Long getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(Long createUserId) {
		this.createUserId = createUserId;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}

	public Long getUpdateUserId() {
		return updateUserId;
	}

	public void setUpdateUserId(Long updateUserId) {
		this.updateUserId = updateUserId;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Task getTask() {
		return task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	public Long[] getAttId() {
		return attId;
	}

	public void setAttId(Long[] attId) {
		this.attId = attId;
	}

	public Long[] getAttaFunds() {
		return attaFunds;
	}

	public void setAttaFunds(Long[] attaFunds) {
		this.attaFunds = attaFunds;
	}

	public Long[] getAttaResult() {
		return attaResult;
	}

	public void setAttaResult(Long[] attaResult) {
		this.attaResult = attaResult;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Long getAuditUserId() {
		return auditUserId;
	}

	public void setAuditUserId(Long auditUserId) {
		this.auditUserId = auditUserId;
	}

	public String getAuditUserName() {
		return auditUserName;
	}

	public void setAuditUserName(String auditUserName) {
		this.auditUserName = auditUserName;
	}

	public Date getAuditTime() {
		return auditTime;
	}

	public void setAuditTime(Date auditTime) {
		this.auditTime = auditTime;
	}

	public List<FeedBackAudit> getFeedBackAudits() {
		return feedBackAudits;
	}

	public void setFeedBackAudits(List<FeedBackAudit> feedBackAudits) {
		this.feedBackAudits = feedBackAudits;
	}

	public String getAuditRemark() {
		return auditRemark;
	}

	public void setAuditRemark(String auditRemark) {
		this.auditRemark = auditRemark;
	}

	public Long getProjectIndexId() {
		return projectIndexId;
	}

	public void setProjectIndexId(Long projectIndexId) {
		this.projectIndexId = projectIndexId;
	}

	public Integer getAuditCount() {
		return auditCount;
	}

	public void setAuditCount(Integer auditCount) {
		this.auditCount = auditCount;
	}

	public String getPreAmount() {
		return preAmount;
	}

	public void setPreAmount(String preAmount) {
		this.preAmount = preAmount;
	}

	public Long getPlanId() {
		return planId;
	}

	public void setPlanId(Long planId) {
		this.planId = planId;
	}

	public TaskPlan getTaskPlan() {
		return taskPlan;
	}

	public void setTaskPlan(TaskPlan taskPlan) {
		this.taskPlan = taskPlan;
	}

	public Date getExecuteTime() {
		return executeTime;
	}

	public void setExecuteTime(Date executeTime) {
		this.executeTime = executeTime;
	}

	public Date getExcTimeBegin() {
		return excTimeBegin;
	}

	public void setExcTimeBegin(Date excTimeBegin) {
		this.excTimeBegin = excTimeBegin;
	}

	public Date getExcTimeEnd() {
		return excTimeEnd;
	}

	public void setExcTimeEnd(Date excTimeEnd) {
		this.excTimeEnd = excTimeEnd;
	}

	public Date getCreateTimeBegin() {
		return createTimeBegin;
	}

	public void setCreateTimeBegin(Date createTimeBegin) {
		this.createTimeBegin = createTimeBegin;
	}

	public Date getCreateTimeEnd() {
		return createTimeEnd;
	}

	public void setCreateTimeEnd(Date createTimeEnd) {
		this.createTimeEnd = createTimeEnd;
	}
	
}
